package com.baitiaojun.api.domain.moments;

import com.baitiaojun.api.domain.user.UserInfo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("日常动态")
public class UserDailyMoments extends UserMoments {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(readOnly = true)
    private Long id;

    @Pattern(regexp = ".{1,600}", message = "内容长度必须在1到600之间")
    @ApiModelProperty(value = "内容", required = true)
    private String content;

    @ApiModelProperty(hidden = true)
    private String pictures;

    @ApiModelProperty(readOnly = true)
    private Date createtime;

    @ApiModelProperty(hidden = true)
    private String type;

    @ApiModelProperty(value = "图片列表")
    private List<String> pictureList;

    @ApiModelProperty(value = "用户信息", hidden = true)
    private UserInfo userInfo;
}